Skip to content

feat: cortex sync-runs — run status from a campaign digest (hpc-campaign p5b) - #83

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/hpc-campaign-p5b-cortex
Oct 30, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/hpc-campaign-p5b-cortex

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

hpc-campaign phase 5b (#82). Adds cortex sync-runs <project> --digest <path> [--dry-run], which updates a project's run lines from a PyAutoFit campaign digest (digest.json + tasks.jsonl). This is new decision 64; the epic ledger calls it "decision 62", but 62 and 63 were already taken.

  • What it changes: a run line moves from open to running once its tasks have started, with a run log entry. It moves to done, with state counts and wall time, once every task index the run names has finished. It is marked failed only when none completed.
  • What it never touches: result, lesson and ## Now. It never adds or removes run lines. It is idempotent, and --dry-run writes nothing.
  • Pending array slices: the scheduler reports these as compound rows (e.g. 3002_[2-3]). They are expanded into their indices and keep the run open.
  • Matching: by the SLURM array job id plus the indices the run names.
  • Writes: all edits are computed and validated first, then written once, so a refusal leaves the file untouched.
  • Command contract: exits 0 on success; exits 1 with empty stdout on a malformed digest; the first stdout line is sync-runs: <project>: <n> changed.
  • Ledger fields: projects.yaml gains optional campaign_file and digest, validated by cortex check.
  • Docs: REFERENCE.md gets the boundary paragraph: run status is a cluster fact; results and lessons are the human's.

Heart RED override (development only)

Heart was RED at the door on 2026-10-30:

  • release validation FAILED (stage integrate), and the Release Integrate workflow failed;
  • PyAutoNerves test_fitsable.py::test__output_to_fits red;
  • unit-test timing: 1 regression (>3× baseline), 14 slow;
  • autogalaxy red; autolens_profiling red;
  • release validation NOT release_ready;
  • worktree drift: 1 dirty.

The human authorized the Human override for Heart RED (development only) live for hpc-campaign phase 5 ("Override + approve"). This PR doesn't touch any RED item. Merging needs green CI and a separate /prm.

Test plan

  • tests/ 91 passed (21 new); cortex check OK on the real ledgers.

  • Independent review: FINDINGS, fixed in d590eac:

    • HIGH: a run was marked done while compound pending slices remained;
    • MEDIUM: a failure partway left earlier runs written;
    • LOW: newest-first log order was not checked for the new entries.

    Each has a regression test. The fixes have not been re-reviewed (time-boxed session).

  • Dry run on a temporary copy against the real DR1 digest: 58 euclid_dr1 runs would close. Applying that to the live ledger needs the human's ask.

Refs #82

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits October 30, 2026 16:06
…cision 64)

`cortex.py sync-runs <project> --digest <digest.json> [--dry-run]` reads a
PyAutoFit autofit.campaign digest and the tasks.jsonl beside it, matches run
lines by SLURM job id (narrowed to the array indices the ident names), flips
open -> running with a run entry, and calls done with the task counts (wall
from first start to last end; failed when none completed) once every matched
task has ended. Writes run entries only, never result/lesson/Now; never adds
or drops a run it cannot account for; idempotent; first stdout line
`sync-runs: <project>: <n> changed`; exit 1 on a malformed digest.

projects.yaml gains optional campaign_file and digest (paths relative to
local_path), validated by check. REFERENCE.md documents the verb, the key and
the boundary (status is a cluster fact; results and lessons are the human's);
decision 64 records hpc-campaign ruling F3.

Refs #82

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A pending array slice the scheduler reports as one row (job_id/key
  3002_[2-3], optionally %throttle) now stands for each of its indices; a
  run is done only when every index its ident names has a terminal row, and
  for a bare job id any unfinished row (compound stubs included) keeps it on
  the ledger. Counts weigh a compound row by its indices, so cancelled stubs
  count per task.
- Every edit is computed in memory, read back and written once: a refusal
  or a failed read-back writes nothing.
- The log's newest-first rule is checked before any entry is written.

Refs #82

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit bf5280e into main Oct 30, 2026
1 check passed
@Jammy2211
Jammy2211 deleted the feature/hpc-campaign-p5b-cortex branch October 30, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant